
let isFirstQueryEnterYkq = true;
/**
 * 询问是否进入当前进行中场次
 * @param {*} activityList 
 */
export const queryEnteryYkqLogic = (activityList) =>{
  

  
  let tmpLen = activityList.length;
  let targetSplid;
  for (let i = 0; i < tmpLen; i += 1) {
    
    if (activityList[i].ykq_info !== '0') {
      targetSplid = activityList[i].id;
      break;
    }
  }
  
  if (targetSplid) {
    wx.showModal({
      title: '提示',
      content: '有一场活动正在进行!是否遥控本场活动!',
      success: res => {
        if (res.confirm) {
          wx.navigateTo({
            url: '/pages/index/controller/controller?liveid=' + targetSplid,
          });
        }
      },
      fail: () => {},
    });
  }
}
/**
 * 查询是否首次进入页面 当第一次进入时询问是否进入当前进行中场次
 */
export const queryFirstEnteryYkqLogic = (activityList) => {
  
  if (!isFirstQueryEnterYkq || activityList.length===0) {
    return;
  }
  queryEnteryYkqLogic(activityList)

  isFirstQueryEnterYkq = false;
}